﻿using OnlineLogCommon;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Net.Sockets;
using System.Text;
using System.Windows.Forms;

namespace OnlineLogClient
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        SocketTcpClient client;
        private void button1_Click(object sender, EventArgs e)
        {
            if (client == null)
            {
                client = new SocketTcpClient();
                client.Connect("192.168.134.196", 8081);
            }
            string str = "";
            Random rand = new Random();
            for (int i = 0; i < 10; i++)
            {
                str += (char)rand.Next(30, 127);
            }
            StringBuilder sb = new StringBuilder();
            for (int i = 0; i < 10 * 1024 * 1024 / 10; i++)
            {
                sb.Append("我有五个字");
            }
            client.Send(sb.ToString());
        }

        private void button2_Click(object sender, EventArgs e)
        {
            client.Dispose();
            client = null;
        }
    }
}
